import api from '../api/api';

// 首页数据的请求
export const GetHomeList = () => api.get('/index/index');

// 获取搜索弹出框的数据
export const GetSearchPopupData = () => api.get('/search/index');

// 获取实时搜索的文本提示的数据列表
export const GetSearchTipsListData = (params) =>
	api.get('/search/helper', { params });

// 获取搜索商品列表的数据
export const GetGoodsListData = (params) => api.get('/goods/list', { params });

// 清除历史记录
export const ClearHistory = () => api.post('/search/clearhistory');

// 登录请求
export const GoLogin = (params) => api.post('/auth/loginByWeb', params);

// 商品详情
export const GetGoodsDetailData = (params) =>
	api.get('/goods/detail', { params });
// 相关产品
export const GetGoodsRelatedData = (params) =>
	api.get('/goods/related', { params });

// 获取购物车产品数量
export const GetGoodsCount = () => api.get('/cart/goodscount');

// 加入购物车
export const AddProductToCart = (params) => api.post('/cart/add', params);

// 获取购物车数据
export const GetCartListData = () => api.get('/cart/index');

// 点击切换商品选中状态
export const ChangeGoodChecked = (params) => api.post('/cart/checked', params);

// 步进器的请求
export const StepperChangeData = (params) => api.post('/cart/update', params);

// 删除商品
export const DeleteGood = (params) => api.post('/cart/delete', params);


//分类
export const Catalog = (params) => api.post('/catalog/index', params);



Catalog(7).then((res) => {
	console.log(res, '测试接口');
});

